package dabs.engine;

import java.util.Iterator;
import java.util.LinkedList;
import dabs.engine.messaging.Notification;
import dabs.engine.messaging.NotificationHandler;

public class DummyInterface implements NotificationHandler {

	LinkedList<Notification> notifs;
	
	public DummyInterface() {
		notifs = new LinkedList<Notification>();
	}

	@Override
	public void handleNotification(Notification notification) {
		notifs.add(notification);
	}
	
	public Notification get() {
		return notifs.remove();
	}
	
	public String toString() {
		String output = "";
		Iterator<Notification> it = notifs.iterator();
		while (it.hasNext()) {
			Notification not = it.next();
			output += not.getSource() + ": " + not.getDescription();
		}
		return output;
	}

}
